1. Field of the Invention
The invention relates in general to a scaling module and a scaling method, and more particularly to a scaling module and method capable of controlling data flow quantity.
2. Description of the Related Art
The typical digital image processing operations include scaling, color adjusting, halftone adjusting, filtering, and data formatting procedures converting for specific I/O apparatuses.
The digital image scaling procedure may greatly increase the data quantity of the scaled digital image. For example, when the digital image is regarded as the two-dimensional signal, the digital image scaling includes the first dimensional (horizontal) scaling followed by the second dimensional (vertical) scaling.
FIG. 1 is a schematic illustration showing the flow of scaling a digital image in one dimension using a conventional scaling module. In FIG. 1, a digital image signal X[n] representative of four pixels of the digital image 4 will be up-scaled by N/M (N equals 4 and M equals 3 in FIG. 1) times by the conventional scaling module 100 according to the interpolation method. After the digital image signal X[n] enters the conventional scaling module 100, the up-sampling device 110 in the scaling module 100 up-samples the digital image signal X[n] by four times. That is, (4-1) zeros are inserted between two pixels among the four pixels represented by the digital image signal X[n] in order to form the digital image signal X1[n].
The low-pass filter 120 filters the digital image signal X1[n] to obtain the signal X2[n] having 16 pixels. Finally, the down-sampling device 130 down-samples the digital image signal X2[n] by three times. That is, one pixel from every three pixels are taken from the 16 pixels of the digital image signal X2[n] so as to form the digital image signal Y[n] having five pixels. So, after the conventional scaling module 100 up-scales the digital image signal X[n] representative of four pixels by 4/3 times, the digital image signal Y[n] having five pixels will be produced.
The above-mentioned procedures only up-scale the digital image signal X[n] in the first-dimensional direction. After the up-scaling in the first-dimensional direction, the up-scaling in the second dimensional direction has to be performed. That is, after the digital image signal X[n] is up-scaled by the conventional scaling module 100, the data quantity contained in the digital image signal Y[n] will increase. If the up-scaling ratio of the scaling module 100 increases, the data quantity contained in the digital image signal Y[n] also increases accordingly.
After the conventional scaling module 100 up-scales the digital image signal X[n], the bulk data contained in the digital image signal has to be processed by some processing units (e.g., the color adjusting unit, halftone adjusting unit, filter unit and data formatting unit for specific I/O apparatus) in the post stage of the scaling module 100. The bulk data processing, however, cannot be completed by the post stage processing units of the scaling module 100 per unit time. Thus, an external memory 230 is needed when the post stage processing units of the conventional scaling module 100 are processing the bulk data.
FIG. 2 is a schematic illustration showing an image processing device including a conventional scaling module. Referring to FIG. 2, the digital image processing device 200 mainly includes a conventional scaling module 100 and some processing units 210 to 220 in its post stage. This architecture has the following drawbacks.
1. When the conventional scaling module 100 is up-scaling, the outputted and up-scaled data increases with an up-scaling ratio, and the subsequent processing units 210 to 220 cannot process the relative bulk data, which is up-scaled, per unit time. Therefore, the external memory 230 is needed to temporarily store the up-scaled data that is outputted from the conventional scaling module 100.
2. When the conventional scaling module 100 is down-scaling, the outputted and down-scaled data decreases with an down-scaling ratio, and the subsequent processing units 210 to 220 can only process the relative amount of down-scaled data per unit time. Thus, the maximum bandwidth cannot be completely used.
In view of this, the invention provides a scaling module and method capable of controlling data input quantity and/or output quantity, of reducing the requirement of the external memory, and of effectively increasing the scaling speed and subsequent processing speed of the digital image signal. Therefore, the efficiency in the processing procedure of the digital image signal can be increased.